package it.infodea.tapestrydea.entities.demo;

import it.infodea.tapestrydea.support.interfaces.Identifiable;

import org.apache.tapestry5.beaneditor.NonVisual;

public class DogBean implements Identifiable {

	@NonVisual
	private Long id;

	private String name;

	private int age;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	@NonVisual
	public Object getDisplayId() {
		return getName();
	}

	public Object getIdValue() {
		return id;
	}

	public void setIdValue(Object idValue) {
		id = (Long) idValue;
	}
	
	public static DogBean newInstance(String name, int age, long id) {
		DogBean dog = new DogBean();
		dog.setName(name);
		dog.setAge(age);
		dog.setIdValue(id);
		return dog;
	}

}
